Add Jenkins Pipeline to test the project automatically#165
Add Jenkins Pipeline to test the project automatically#165justinyeh1995 wants to merge 114 commits intoSimIntToolkit:developfrom
Conversation
| zip | ||
|
|
||
| #install Gradle | ||
| ARG GRADLE_VERSION=7.5 |
There was a problem hiding this comment.
Not sure if this is needed -- the gradle-wrapper (gradle wrapper --gradle-version=8.0) should accomplish that same thing. You just need to use ./gradlew instead of gradle when executing gradle
Let's also use gradle 8.0
cpswt-core/config/build.gradle.kts
Outdated
| val snapshotsRepoUrl = "http://$archivaHostId:$archivaPort/repository/snapshots" | ||
| url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else internalRepoUrl) | ||
|
|
||
| val internalRepoUrl = "http://localhost:8080/repository/internal" |
There was a problem hiding this comment.
archivaHostId and archivaPort shouldn't be hardcoded.
If the gradle.properties file isn't working, you should be able to provide them on the command-line of ./gradlew via -PachivaHostId=localhost and -ParchivaPort=8080
There was a problem hiding this comment.
This comment is fixed and the changes result in a successful build.
experiment_wrapper.sh
Outdated
|
|
||
| gradle wrapper --gradle-version=7.5 | ||
|
|
||
| ARCHIVA_REPO_URL="http://localhost:8080/repository/snapshots/0.7.0-SNAPSHOT/" |
There was a problem hiding this comment.
We need to find some way of making the version consistent -- should be 0.8.0-SNAPSHOT
There was a problem hiding this comment.
This comment is fixed and the changes result in a successful build.
gradle.properties
Outdated
| archivaPassword=adminpass123 | ||
| archivaHostId=localhost | ||
| archivaPort=8080 | ||
| version=0.7.0-SNAPSHOT |
There was a problem hiding this comment.
This comment is fixed and the changes result in a successful build.
| echo "archiva launched" | ||
|
|
||
| # create admin user | ||
| curl --no-progress-meter -X POST -H "Content-Type: application/json" -H "Origin: http://localhost:8080" -d @- \ |
There was a problem hiding this comment.
This part should probably go in the docker somehow -- perhaps with a script that:
- starts archiva
- waits for it to go online
- sets up the admin user
- shuts down archiva
experiment_wrapper.sh
Outdated
|
|
||
| # run the HelloWorldJava example | ||
| cd /home/cpswt/cpswt-core/examples/HelloWorldJava | ||
| gradle wrapper --gradle-version=7.5 |
There was a problem hiding this comment.
This comment is fixed and the changes result in a successful build.
experiment_wrapper.sh
Outdated
| git clone https://github.com/SimIntToolkit/cpswt-core.git | ||
| cd cpswt-core/cpswt-core | ||
|
|
||
| gradle wrapper --gradle-version=7.5 |
There was a problem hiding this comment.
This comment is fixed and the changes result in a successful build.
|
I am now moving these files into .jenkins/ to make the project more readable and manageable. |
What's added
Additional context
Adding a Webhook in this repository is recommended.
Further testing can only be made after merging.